package com.project.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.project.bean.GradeBean;
import com.project.bean.RoleBean;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface IRoleMapper extends BaseMapper<RoleBean> {
    public  void  addGradeList(@Param("roleId") int roleId, @Param("gradeArray") int []gradeArray);
    public List<GradeBean> findByRoleId(int id);


    public void updateGrade(@Param("id") int id, @Param("gradeArray") int[] gradeArray);
@Delete("delete from t_role_grade where fk_roleId=#{id};" +
        "delete from t_user_role where fk_roleId=#{id};" +
        "delete from t_role where pk_roleId=#{id}")
    public  void  del(int id);
}
